<template>
	<view class="content">
		<view class="item"><text class="item_left">考试科目：</text><text class="item_right">{{title}}</text></view>
		<view class="item"><text class="item_left">考试数量：</text><text class="item_right">{{count}}题目</text></view>
		<view class="item"><text class="item_left">考试时间：</text><text class="item_right">{{time}}分钟</text></view>
		<view class="item"><text class="item_left">出题规则：</text><text class="item_right">按规定比例随机抽取</text></view>
	
	<view class="sub" @click="sub()">
		<button class="sub_but">开始考试</button>
	</view>
	</view>
</template>

<script>
	import unils from "../../unils/utils.js"
	export default {
		data() {
			return {
				'title':"",
				'count':10,
				'time':10
			}
		},
		onShow(){
			try{
				let categoryName = uni.getStorageSync('category');
				if(categoryName){
					console.log(categoryName)
					this.title = categoryName;
				}
				
			} catch(e){
				
			}
		},
		methods: {
			sub(){
				const openid = uni.getStorageSync('openid');
				if(unils.stringIsEmpty(openid)){
					uni.showToast({
						title:"请先登录！",
						duration:2000,
						icon:"none"
					})
					uni.navigateTo({
						url:"../login/login"
					})
					return;
				}
				uni.navigateTo({
					url:"../kaoshi2/kaoshi2"
				})
			},
		}
	}
</script>

<style lang="scss">
	.content{
		padding-top: 100px;
		.item{
			display: flex;
			// width:100%;
			font-size: 14px;
			// align-items: center;
			justify-content: center;
			// margin: 0 auto;
			heigh:30px;
			line-height: 30px;
			.item_right{
				color:#007AFF;
			}
		}
		.sub{
			background-color: #f07373;
			position: fixed;
			bottom: 0px;
			width:100%;
			.sub_but{
				background-color: #f07373;
				color:#ffffff;
			}
		}
	}
	

</style>
